<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Spec extends Base
{
    protected $fillable = ['type_id', 'order', 'name', 'index'];
    protected $hidden = ['created_at', 'updated_at'];
    protected $casts = [
        'index'  => 'boolean'
    ];

    public function type()
    {
        return $this->belongsTo('App\Type');
    }

    public function items()
    {
        return $this->hasMany('App\SpecItem');
    }
}
